﻿<Window x:Class="VSLT_Reporting_UI.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="VSLT Reporting Database Setup Utility" Height="800" Width="1024" Loaded="Window_Loaded">
    <Window.Resources>
        <HierarchicalDataTemplate x:Key="template">
            <TextBlock Text="{Binding XPath=@name}" />
            <HierarchicalDataTemplate.ItemsSource>
                <Binding XPath="node" />
            </HierarchicalDataTemplate.ItemsSource>
        </HierarchicalDataTemplate>
        <XmlDataProvider x:Key="xmlDataProvider"></XmlDataProvider>
    </Window.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="55" />
            <RowDefinition Height="*" />
            <RowDefinition Height="30" />
            <RowDefinition Height="25" />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <Label Content="SQL Connection String for Load Test Results DB" />
            <TextBox x:Name="tbSqlConn" Text="" Margin="10,3" TextChanged="tbSqlConn_TextChanged" />
        </StackPanel>
        <TabControl x:Name="tabControl" Grid.Row="1">
            <TabItem x:Name="tabMessageBox" Header="Messages">
                <TextBox x:Name="tbResults" Grid.Row="1" Margin="3" Padding="3" />
            </TabItem>
            <TabItem x:Name="tabListOfRuns" Header="Test Runs">
                <DataGrid x:Name="dgMainResults" Margin="3" AutoGenerateColumns="True"			 
					SelectionChanged="dgMainResults_SelectionChanged" IsReadOnly="True" />
            </TabItem>
            <TabItem x:Name="tabIntervalResults" Header="Test Interval Results">
                <ScrollViewer CanContentScroll="True" Grid.IsSharedSizeScope="True">
                <StackPanel x:Name="spIntervalResults">
                </StackPanel>
                </ScrollViewer>
            </TabItem>
            <TabItem x:Name="tabListOfData" Header="Data To Retrieve" >
                <DataGrid x:Name="dgQueryList" Margin="3" AutoGenerateColumns="True" IsReadOnly="True" />
            </TabItem>
            <TabItem x:Name="tabDataGrid" Header="Results" >
                <DataGrid x:Name="dgQueryResults" AutoGenerateColumns="True" IsReadOnly="True" AlternatingRowBackground="#FFC0FFFF" 
					AlternationCount="1" FontFamily="Arial">
                    <DataGrid.CellStyle>
                        <Style>
                            <Style.Triggers>
                                <Trigger Property="DataGridCell.IsSelected" Value="True">
                                    <Setter Property="DataGridCell.Background" Value="SteelBlue" />
                                    <Setter Property="DataGridCell.BorderBrush" Value="GreenYellow" />
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </DataGrid.CellStyle>
                </DataGrid>
            </TabItem>
        </TabControl>
        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button x:Name="btnUpdateDb" Content="Update DB" HorizontalAlignment="Right" Margin="5" VerticalAlignment="Center" Width="75" Click="btnUpdateDb_Click" ToolTip="Updates the Tables, Views and Stored Procedures used to enhance Load Test Reporting" />
            <Button x:Name="btnUpdaTablesDb" Content="Refresh" HorizontalAlignment="Right" Margin="5,5,5,5" VerticalAlignment="Center" Width="75" Click="btnUpdaTablesDb_Click" ToolTip="Executes the stored procedures that rebuild any missing warehouse data in the custom DB Tables"/>
            <Button x:Name="btnGetResults" Content="Update Intervals" HorizontalAlignment="Right" Margin="5,5,75,5" VerticalAlignment="Center" Width="75" Click="btnGetResults_Click" />
            <Button x:Name="btnGetRuns" Content="Get Runs" HorizontalAlignment="Right" Margin="5" VerticalAlignment="Center" Width="75" Click="btnGetRuns_Click" />
            <Button x:Name="btnGetIntervals" Content="Get Intervals" HorizontalAlignment="Right" Margin="5" VerticalAlignment="Center" Width="75" Click="btnGetIntervals_Click" />
            <Button x:Name="btnClose" Content="Exit" HorizontalAlignment="Right" Margin="5" VerticalAlignment="Center" Width="75" Click="btnClose_Click" />
        </StackPanel>
        <StatusBar x:Name="sbStatus" Grid.Row="3" >
            <StatusBarItem x:Name="sbiMessageItem">
                <Label x:Name="tsslMessage" Padding="10,0,10,0" Content="" MinWidth="500"/>
            </StatusBarItem>
        </StatusBar>
    </Grid>
</Window>
